﻿#include "ufxconfig.h"

UFXConfig::UFXConfig(){
    m_conf = NewConfig();
    m_conf->AddRef();
    char configPath[256];
    sprintf(configPath,"Config.ini");
    m_conf->Load(configPath);
}
UFXConfig::~UFXConfig(){
    m_conf->Release();
}

QString UFXConfig::GetString(const char *szSection, const char *szEntry, const char *szValue){
    m_mutex.lock();
    QString value =  m_conf->GetString(szSection,szEntry,szValue);
    m_mutex.unlock();
    return value;
}
void UFXConfig::SetString(const char *szSection, const char *szEntry, const char *szValue){
    m_mutex.lock();
    m_conf->SetString(szSection,szEntry,szValue);
    m_conf->Save("Config.ini");
    m_mutex.unlock();
}

UFXConfig* UFXConfig::getInstance(){
    return instance;
}

UFXConfig::UFXConfig(const UFXConfig&){

}
UFXConfig& UFXConfig::operator=(const UFXConfig&){
    return *instance;
}




